package com.barunlab.ems.library;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;

/**
 * Properties 파일을 로딩하는 클래스
 * 
 * @author 배수현
 * @version R1.0
 * @since JDK6.0
 * @created 2013
 */
public class PropertyLoader {
	/**
	 * 입력받은 Properties 파일을 로딩한다. 
	 * @param filePath
	 * @return
	 * @throws Exception
	 */
	public static Properties load(String filePath) throws Exception {
		Properties props = new Properties();
		InputStream inputStream = null;
		try {
			//inputStream = ClassLoader.getSystemClassLoader().getResourceAsStream(filePath);
			inputStream = new FileInputStream(new File(filePath));
			props.load(inputStream);
		}
		finally {
			if ( inputStream != null ) {
				try {
					inputStream.close();
				}
				catch ( Exception ex ) {
					ex.printStackTrace();
				}
			}
		}
		
		return props;
	}
}
